<div class="col-md-12">
	<h3 class="header smaller lighter blue">
		<span>主机房迁移</span>
		<button class="btn btn-sm btn-success" ng-if="migrationSysCheckResp.success === true">
			<i class="ace-icon fa fa-check"></i>可以进行DR切换
		</button>

		<button class="btn btn-sm btn-warning" ng-click="showErrorMessage()" ng-if="migrationSysCheckResp.warning === true">
			<i class="ace-icon fa fa-bolt bigger-110"></i>
			警告
			<i class="ace-icon fa fa-arrow-right icon-on-right"></i>
		</button>
		<button class="btn btn-sm btn-danger" ng-click="showErrorMessage()" ng-if="migrationSysCheckResp.error === true">
			<i class="ace-icon fa fa-bolt bigger-110"></i>
			不能进行DR切换
			<i class="ace-icon fa fa-arrow-right icon-on-right"></i>
		</button>

	</h3>

	<div class="panel panel-primary">
		<header class="panel-heading">
			<div class="row">
				<div class="col-sm-3">
					<md-checkbox class="border-white" ng-checked="isChecked()" md-indeterminate="isIndeterminate()" ng-click="toggleAll()"></md-checkbox>
					<span ng-if="isChecked()">取消全选</span> <span ng-if="!isChecked()">全选</span>
				</div>
				<div class="col-sm-6">
					<span class="col-md-4">
						<md-select md-on-close="sourceDcSelected()"
								   ng-model="sourceDc"
								   class="md-no-underline color-white radius-border-fat no-margin" required placeholder="源机房">
							<md-option ng-repeat="dc in dcs" value="{{dc.dcName}}">{{dc.dcName}}</md-option>
						</md-select>
					</span>
					<span class="col-md-4">
						<md-select md-on-close="clusterOrgNameSelected()"
								   allow_single_deselect=true
								   ng-model="clusterOrgName"
								   class="md-no-underline color-white radius-border-fat no-margin" placeholder="组织部门">
							<md-option ng-repeat="org in organizations" value="{{org.orgName}}">{{org.orgName}}</md-option>
						</md-select>
					</span>
					<span class="col-md-4">
						<md-select md-on-close="getMasterUnhealthyClusters()"
								   allow_single_deselect=true
								   ng-model="masterUnhealthyClusterState"
								   class="md-no-underline color-white radius-border-fat no-margin" placeholder="Master有问题的Cluster">
							<md-option ng-repeat="stateLevel in masterUnhealthyClusterStateLevels" value="{{stateLevel.level}}">{{stateLevel.name}}</md-option>
						</md-select>
					</span>
				</div>
				<div class="col-md-3 text-right	">
					<a type="button" href="/api/dr/progress" target="_blank" class="btn btn-primary radius-border-fat"><strong>进度</strong></a>
					&nbsp&nbsp
					<a type="button" ng-show="enableMigrationButton" ng-click="preMigrate()" class="btn btn-primary radius-border-fat"><strong>迁移</strong></a>
					&nbsp&nbsp
					<a type="button" class="btn btn-danger radius-border-fat" href="/#/migration_event_list"><strong>取消</strong></a>
				</div>
				<div class="col-md-1"></div>
			</div>
		</header>

		<table ng-table="tableParams" class="table table-striped table-hover">
			<tr ng-repeat="cluster in $data">
				<td data-title="'确认框'">
					<md-checkbox ng-checked="cluster.selected" ng-click="cluster.selected = !cluster.selected"></md-checkbox>
				</td>
				<td data-title="'cluster'">{{cluster.clusterName}}</td>
				<td data-title="'cluster部门'">{{cluster.clusterOrgName}}</td>
				<td data-title="'cluster描述'">{{cluster.clusterDescription}}</td>
				<td data-title="'目标主机房'">
					<md-select ng-model="cluster.targetDc" md-on-close="targetDcSelected(cluster)" class="md-no-underline no-margin radius-border-thin" required placeholder="目标主机房" ng-if="availableTargetDcs(cluster).length > 1">
						<md-option value="-" ng-selected="true">-</md-option>
						<md-option ng-repeat="dcInfo in availableTargetDcs(cluster)" value="{{dcInfo.dcName}}">{{dcInfo.dcName}}</md-option>
					</md-select>
					<md-select ng-model="cluster.targetDc" md-on-close="targetDcSelected(cluster)" class="md-no-underline no-margin radius-border-thin" required placeholder="目标主机房" ng-if="availableTargetDcs(cluster).length == 1">
						<md-option value="{{availableTargetDcs(cluster)[0].dcName}}" ng-selected="true">{{availableTargetDcs(cluster)[0].dcName}}</md-option>
					</md-select>
				</td>
			</tr>
		</table>
	</div>
</div>

<a href="#" id="btn-scroll-up"
	class="btn-scroll-up btn btn-sm btn-inverse"> <i
	class="icon-double-angle-up icon-only bigger-110"></i>
</a>

<xpipeconfirmdialog xpipe-dialog-id="'errorMessage'" xpipe-title="'检测错误信息'"
					xpipe-detail="migrationSysCheckResp.message" xpipe-show-cancel-btn="false"
					xpipe-confirm="hideErrorMessage"></xpipeconfirmdialog>

<xpipeconfirmdialog xpipe-dialog-id="'createEventWithLostConfirm'" xpipe-title="'创建事件'"
                    xpipe-detail="'仍然有未指定目标机房的Cluster，是否继续（将忽略未指定目标机房的集群）?'"
                    xpipe-show-cancel-btn="true" xpipe-confirm="doMigrate"></xpipeconfirmdialog>